home *** CD-ROM | disk | FTP | other *** search
/ WINMX Assorted Textfiles / Ebooks.tar / Text - Tech - OS - NT - security guide 03.txt < prev    next >
Text File  |  2003-09-27  |  10KB  |  168 lines

  1. NT security guideSection 03
  2. Passwords
  3.  
  4. 03-1. How do I access the password file in NT?
  5. 03-2. How do I crack NT passwords?
  6. 03-3. What is a "brute force" password cracker?
  7. 03-4. What is a "dictionary" password cracker?
  8. 03-5. Which method is best for cracking?
  9. 03-6. How does a Sys Admin enforce better passwords?
  10. 03-7. Can an Sys Admin prevent/stop SAM extraction?
  11.  
  12.  
  13.  
  14. 03-1. How do I access the password file in NT?
  15. The location of what you need is in \\WINNT\SYSTEM32\CONFIG\SAM which is the 
  16. location of the security database. This is usually world readable by default, 
  17. but locked since it is in use by system compotents. It is possible that there 
  18. are SAM.SAV files which could be readable. If so, these could be obtained for 
  19. the purpose of getting password info. 
  20. During the installation of NT a copy of the password database is put in 
  21. \\WINNT\REPAIR. Since it was just installed, only the Administrator and Guest 
  22. accounts will be there, but maybe Administrator is enough -- especially if the 
  23. Administrator password is not changed after installation. 
  24. If the Sys Admin updates their repair disks, or you get a hold of a copy of the 
  25. repair disks, you can get password database. The file is SAM._ in the ERD 
  26. directory. 
  27. If you are insane, you can go poking around in the SAM secret keys. First, 
  28. schedule service to logon as LocalSystem and allow it to interact with the 
  29. desktop, and then schedule an interactive regedt32 session. The regedt32 session 
  30. will be running as LocalSystem and you can play around in the secret keys. 
  31. However, if you change some stuff this might be very bad. You have to be 
  32. Administrator to do this, though, so for the hacker you need to walk up to the 
  33. machine while the Administrator is logged in and distract them by telling them 
  34. they're giving away Microsoft t-shirts in the lobby (this doesn't always work 
  35. ;-). 
  36.  
  37.  
  38.  
  39. 03-2. How do I crack NT passwords?
  40. First off, it should be explained that the passwords are technically not located 
  41. on the server, or in the password database. What IS located there is a one-way 
  42. hash of the password. Let me explain... 
  43. Two one-way hashes are stored on the server -- a Lan Manager password, and a 
  44. Windows NT password. Lan Manager uses a 14 byte password. If the password is 
  45. less than 14 bytes, it is concantenated with 0's. It is converted to upper case, 
  46. and split into 7 byte halves. An 8 byte odd parity DES key is constructed from 
  47. each 7 byte half. Each 8 byte DES key is encrypted with a "magic number" 
  48. (0x4B47532140232425 encrypted with a key of all 1's). The results of the magic 
  49. number encryption are concantenated into a 16 byte one way hash value. This 
  50. value is the Lan Manager "password". 
  51. A regular Windows NT password is derived by converting the user's password to 
  52. Unicode, and using MD4 to get a 16 byte value. This hash value is the NT 
  53. "password". 
  54. So to crack NT passwords, the username and the corresponding one way hashes (Lan 
  55. Man and NT) need to be extracted from the password database. Instead of going 
  56. out and writing some code to do this, simply get a copy of Jeremy Allison's 
  57. PWDUMP, which goes through SAM and gets the information for you. PWDUMP does 
  58. require that you are an Administrator to get stuff out of the registry, but if 
  59. you can get ahold of copies of the security database from another location (see 
  60. Section 03-1) you can use those. 
  61. Obviously from this point you can use one of several cracking utilities to 
  62. perform either a brute force or dictionary attack on either the Lan Man or NT 
  63. password. Several freeware products are available on the Internet. They include: 
  64.  
  65. Cracker          Author(s)           Compiles on...  Notes
  66. ---------------- ------------------- --------------- ----------------------
  67. c50a-nt-0.20.tgz Bob Tinsley         Unix            Dictionary cracker, a
  68.                                                      port of Alec Muffett's
  69.                                                      Crack 5.0 for Unix.
  70.  
  71. lc15exe.zip      Mudge and Weld Pond Unix, includes  Best of the bunch, can
  72.                   from the L0pht     GUI NT version  do brute force very
  73.                                      and DOS version quickly, also can use
  74.                                                      a dictionary.
  75.  
  76. NTCrack.tar.gz   Jonathan Wilkins    Unix, includes  Dictionary cracker, on
  77.                                      NT version      it's second revision.
  78.  
  79.  
  80.  
  81.  
  82. 03-3. What is a "brute force" password cracker?
  83. A brute force cracker simply tries all possible passwords from legal characters 
  84. until it gets the password. From a cracker perspective, this is usually very 
  85. time consuming. L0phtcrack 1.5, a brute force cracker, makes certain assumptions 
  86. and reduces this time down considerably. 
  87. As pointed out in section 03-2, the Lan Manager password concantenated to 14 
  88. bytes, and split in half. The halves can be worked on individually. If the 
  89. password was originally only 7 characters or less, that second half is always 
  90. 0xAAD3B435B51404EE. To further ease brute force cracking, since a substantial 
  91. reduction in bits occurs during the deriving of the 8 byte DES key from the 7 
  92. byte key, less keys have to be tried. Also since the password is converted to 
  93. upper case before one way encrypting it, Lan Manager password cracking does not 
  94. have to take into consideration the possibility of lower case letters. 
  95. L0phtcrack incorporates techniques to exploit all of these possibilities. 
  96. By cracking the Lan Manager password first, the NT password can be brute forced 
  97. to determine the proper case of each alpha character. 
  98. Initital tests of L0phtcrack show its brute force capability to be quite 
  99. admirable. A brute force of Administrator on the NMRC dedicated cracking machine 
  100. took 7 days (some Unix passwords have been worked on for 3 weeks before being 
  101. cracked). The NMRC dedicated cracking machine is running Slackware on a 486 
  102. DX50, so this is quite quite fast by NMRC standards. 
  103. The latest version, L0phtCrack 1.5, is even faster. 
  104.  
  105.  
  106.  
  107. 03-4. What is a "dictionary" password cracker?
  108. All three of the password crackers listed in section 03-2 can do dictionary 
  109. attacks. A dictionary attack is simply takes a list of dictionary words, and one 
  110. at a time encrypts them using the same encryption algorithm NT uses to check and 
  111. see if they encrypt to the same one way hash. If the hashes are equal, the 
  112. password is considered cracked. The best of these dictionary crackers is the 
  113. Crack 5.0 NT port, namely because of the strength of the mutation filters. These 
  114. filters allow you to change "idiot" to "1d10t" and other advanced variations to 
  115. get the most from a word list. 
  116. Although L0phtcrack doesn't do the permutations like Crack, there are several 
  117. ways you can "pre-treat" a word list, in particular you can use the DOS-based 
  118. TPU. This utility does a number of filter operations, so with the right amount 
  119. of creativity you can create a pretty substantial list. 
  120.  
  121.  
  122.  
  123. 03-5. Which method is best for cracking?
  124. Actually it depends on your resources and your needs. If you simply need to 
  125. crack a password and there is no real time limit (just raw CPU to waste) then 
  126. brute force is the way to go. If you need a password quickly, using a wordlist 
  127. might shorten your time. In general, a swipe with a couple of decent word lists 
  128. will get some, permutations can get a few more, and the rest can be simply brute 
  129. forced. Watch what the cracked passwords are. If you can spot a pattern, such as 
  130. all lower case with 2 numbers at least six characters long, this may give you 
  131. some clues for what to feed your brute forcer. 
  132.  
  133.  
  134.  
  135. 03-6. How does a Sys Admin enforce better passwords?
  136. There are several freeware utilities that allow for password changing with rules 
  137. enforced. These range from the simple passwd utility by Alex Frink to 
  138. Microsoft's own utilities. The NT Server 4.0 Resource Kit has a utility called 
  139. Passprop that enforces random passwords. Also on Service Pack 2 is a DLL called 
  140. PASSFILT that will does basically the same thing. 
  141.  
  142.  
  143.  
  144. 03-7. Can an Sys Admin prevent/stop SAM extraction?
  145. As long as you can get in as Administrator, you are basically vulnerable. 
  146. Microsoft has gradually increased its security for the SAM files and the hashes, 
  147. but as things like L0phtCrack are quickly improved and Microsoft insists on 
  148. backward compatibility with LAN Manager-style logins, things will be vulnerable. 
  149. In fact, the latest L0phtCrack can take input from stored sniffer traces to use 
  150. as the source for its password cracking. So for you sys admins out there, keep 
  151. absolutely current of Service Packs and Hot Fixes. For you hackers out there, 
  152. well, it's a big bright world ;-) 
  153.  
  154.  
  155.  
  156. 03-8. How is password changing related to "last login time"?
  157. Let's say an admin is checking the last time certain users have logged in by 
  158. doing a NET USER /DOMAIN. Is the info accurate? Most of the time it will NOT be. 
  159.  
  160. Most users do not login directly to the Primary Domain Controller (PDC), they 
  161. login to a Backup Domain Controller (BDC). BDCs do NOT contain readonly versions 
  162. of SAM, they contain read-write versions. To keep the already ungodly amount of 
  163. network traffic down, BDCs do not tell the PDC that they have an update of the 
  164. last login time until a password change has been done. And the NET USER /DOMAIN 
  165. command checks the PDC, so last login time returned from this command could be 
  166. wildly off (it could even show NEVER). 
  167. As a hacker, if you happen to know that password aging is not enforced, then you 
  168. can bet that last login times will probably not be very accurate.